﻿ 
// 创建者： DZT

////////////Begin: 增加透明层////////////////////////////
var gUA=navigator.userAgent.toLowerCase();
var gMoz=gUA.indexOf('gecko')!=-1&&gUA.indexOf('safari')==-1;
var gIE=gUA.indexOf('msie')!=-1&&gUA.indexOf('opera')==-1&&gUA.indexOf('webtv')==-1;

function showElem(elm){
   elm && (elm.style.visibility="");
}

function hideElem(elm){
    elm && (elm.style.visibility="hidden");
}
function showAllMask()
{
    try{
        window.parent.showMask();
    } catch (e) {};
    
    try {
        showMask();
    } catch(e) {};
}
function hideAllMask()
{
    try{
        window.parent.hideMask();
    } catch (e) {};
    
    try {
        hideMask();
    } catch(e) {};
    
}
function showMask()
{
	var gHideSelects = false;if (gIE) {var pos1 = gUA.indexOf('msie') + 4;var pos2 = gUA.indexOf(';', pos1);var brsVersion = parseInt(gUA.substring(pos1, pos2), 10);if(brsVersion < 7) {gHideSelects = true;}};

    var mask = document.getElementById("popupMask");
    if(!mask)
    {
        mask = document.createElement("DIV");
        mask.id = "popupMask";
    }
    if(gHideSelects)
    {
        var ol=document.getElementsByTagName("select");
        for(var i=0;i<ol.length;i++)
        {
            hideElem(ol[i]);
        }
    }
    var height = document.body.clientHeight;
    mask.style.height = height + "px";
    mask.style.display = "block";
}
function hideMask()
{
	var gHideSelects = false;if (gIE) {var pos1 = gUA.indexOf('msie') + 4;var pos2 = gUA.indexOf(';', pos1);var brsVersion = parseInt(gUA.substring(pos1, pos2), 10);if(brsVersion < 7) {gHideSelects = true;}};

    var mask = document.getElementById("popupMask");
    if(gHideSelects)
    {
        var ol=document.getElementsByTagName("select");
        for(var i=0;i<ol.length;i++)
        {
            showElem(ol[i]);
        }
    }
    if(!mask)
    {
        return;
    }    
    mask.style.display = "none";
}
////////////END: 增加透明层////////////////////////////